#!/usr/bin/env python
# coding:utf-8
# @copyRight heitfei
# 2017-06-03 05:44:41

import time

def binarySearch(alist, item):
    first = 0
    last = len(alist) - 1
    found = False

    while first <= last:
        #time.sleep(1)
        mdpoint = (first + last) // 2
        #print "md =",mdpoint, alist[mdpoint]
        if alist[mdpoint] == item:
            #print "fond == True"
            return True
        elif alist[mdpoint] < item:
            #print " < "
            first = mdpoint + 1
            #print first,last
        else:
            #print " > "
            last = mdpoint - 1
            #print first,last

    return False

if __name__ == "__main__":
    l = list(range(2000000))
    # print l
    # print binarySearch(l, 19)
    for i in range(len(l)):
        #print i
        if not binarySearch(l, i):
            print "i not found",i